#include<iostream>
#include<string>

class Test
{
    public:
    Test()
    {
        a++;
    }
    static void func()//静态成员函数
    {

    }
    ~Test()
    {
        a--;
    }


public:
        static int a;//静态成员变量
    //不属于某个特定的对象，属于整个类
};
int Test::a = 0;
int main()
{
    Test *t1 = new Test;
    Test *t2 = new Test;
    delete t1;
    delete t2;
    std::cout << Test::a << std::endl;

    return 0;
}